/*      > H.Stat - Header file for stat call    */

#ifndef __sys_stat
#define __sys_stat

struct stat
{
        /* Unix equivalent fields */
        unsigned short  st_mode;        /* mode bits */
        short           st_nlink;       /* number of links to file */
        short           st_uid;         /* user id of owner ( = 0 ) */
        short           st_gid;         /* group id of owner ( = 0 ) */
        off_t           st_size;        /* file size in characters */
        time_t          st_mtime;       /* time file last written or created */
        /* Arm file attribute details */
        unsigned char   st_stamp;       /* is the file timestamped? */
        unsigned int    st_load;        /* load address */
        unsigned int    st_exec;        /* execution address */
        unsigned short  st_type;        /* file type */
        unsigned char   st_attribs;     /* file attributes */
        sys_time        st_time;        /* time stamp (Arm format) */
};

/* Parts of st_mode field */

#define S_IFMT          0170000         /* type of file */
#define   S_IFDIR       0040000         /* directory */
#define   S_IFREG       0100000         /* regular */
#define S_IREAD         0000400         /* read permission, owner */
#define S_IWRITE        0000200         /* write permission, owner */
#define S_IEXEC         0000100         /* execute permission, owner */

/* Parts of st_attribs field */

#define S_AREAD         0x01            /* Read access for user */
#define S_AWRITE        0x02            /* Write access for user */
#define S_ALOCK         0x08            /* File is locked */

/* K&R equivalent definition */

#ifdef PCC

extern int stat();
extern int set_stat();

#else

extern int stat (char *name, struct stat *buf);
extern int set_stat (char *name, struct stat *buf);

#endif

#endif
